const seq = require('../db_connect'),
      { STRING, INT, TEXT } = require('../../configs/db_type');

const Student = seq.define('student', {
  sid: {
    comment: 'Student_ID',
    type: 'INT',
    allowNull: false,
    unique: true
  },
  studentImgUrl: {
    comment: 'Student_Image_url',
    type: STRING,
    allowNull: false
  },
  studentName: {
    comment: 'Student_name',
    type: STRING,
    allowNull: false
  },
  intro: {
    comment: 'Student_introdution', 
    type: TEXT,
    allowNull: false
  },
  courseName: {
    comment: 'The_course_name_which_this_student_concerned',
    type: STRING,
    allowNull: false
  },
  courseLink: {
    comment: 'This_link_of_the_course_whhich_the_student_concerned',
    type: STRING,
    allowNull: false
  },
  studentImgKey: {
    comment: 'Qiniu_student_image_key',
    type: STRING,
    allowNull: false
  },
  status: {
    comment: 'student_status', //控制是否显示
    type: INT,
    defaultValue: 1,  
    allowNull: false  //设初始值要同时设置非空
  }
})

module.exports = Student;